In - Depth Coverage of the Icon Programming Language The Icon Analyst

نویسندگان

  • D. V. McDermott
  • G. J. Sussman
  • D. H. D. Warren
چکیده

Early artificial intelligence programming languages that incorporated search and backtracking facilities did not limit backtracking to previous computations when a portion of a search failed [1]. This had two unpleasant consequences: (1) the amount of data that had to be retained to allow backtracking limited the problems that could be handled, and (2) unexpected failure could cause backtracking arbitrarily far back in program execution and produce unexpected and sometimes mysterious results. In subsequent artificial intelligence languages, this problem was dealt with by allowing the search tree to be pruned — portions discarded, freeing up the associated memory and preventing backtrack-ing beyond that point [2,3]. Prolog introduced the cut operator for similar reasons [4]. Icon deals with this problem in a different way by limiting backtracking syntactically and requiring the programmer to explicitly construct backtracking that has a large scope. Semicolons, for example, prevent backtrack-ing to previous expressions. This is in contrast to conjunction in which there is no such limitation. Thus, in e1; e2 once the evaluation of e1 either fails or produces a result, evaluation continues to e2, but if it fails backtracking to e1 for possible alternative results does not occur. On the other hand, in e1 & e2 if e1 produces a result but e2 fails, backtracking occurs into e1 for possible alternative results. The Icon compiler inserts a semicolon at the end of a line if the line ends in a complete expression and the next line starts with the beginning of 2 / The Icon Analyst 54 can be written as e1 e2 e3 … en Once the evaluation of a line is complete, evaluation goes on to the next line and failure cannot cause backtracking upward to previous lines.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Analyzing Character Patterns

About This Issue ................................ 1 Analyzing Character Patterns .......... 1 Versum Deltas .................................... 7 Graphics Corner ............................... 10 Tricky Business ................................ 14 From the Library .............................. 19 What’s Coming Up ..........................20 In-Depth Coverage of the Icon Programming Language...

متن کامل

In-Depth Coverage of the Icon Programming Language

Weave Draft Representation ....................... 1 From the Library ........................................... 3 Graphics Corner ............................................ 4 Exploring Sequences Interactively ............. 7 Answers to Quiz ........................................... 9 Woven Images ............................................. 10 Shadow-Weave Wallpaper ........................

متن کامل

In-Depth Coverage of the Icon Programming Language

10. Avoid long lines. Instead, continue expressions on as many lines as are needed for easy readability. See the first two issues of The Icon Analyst for the proper techniques for breaking lines. Similarly, continue long string and cset literals on several lines if that’s necessary to make them readable. See Appendix A of the second edition of The Icon Programming Language for the method of con...

متن کامل

In-Depth Coverage of the Icon Programming Language Shaft Arithmetic

Shaft Arithmetic ............................................ 1 Periodic Sequences ....................................... 5 Finding Repeats ............................................ 7 Name Drafting ............................................ 11 Variations on Versum Sequences ............. 15 Answers to Last Quiz ................................. 18 From the Library ...........................

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999